package com.tan.kotlintest.activity

import android.view.View
import com.tan.kotlintest.R
import com.tan.kotlintest.base.BaseActivity
import com.tan.kotlintest.util.LogUtil

/*
 * Copyright (C) 2018 重庆一聊高科技有限公司
 * 版权所有
 *
 * 功能描述：测试Kotlin中可null类型
 * 作者：txj
 * 创建时间：2018/9/5
 *
 * 修改人：
 * 修改描述：
 * 修改日期
 */
class TestNullActivity : BaseActivity() {

    private var testNullActivity: TestNullActivity? = null

    private var mTestNull: String? = null
    //是否关注
    private var mIsFollowed: Int = 0

    private var mActorId: Int = 0

    public val mTestInt: Int = 0

    override fun getContentView(): View? {
        return inflate(R.layout.activity_make_appo)
    }

    override fun onContentAdded() {
        mActorId = intent.getIntExtra("", 0)
        val result = mTestNull?.length ?: 0
        LogUtil.i("空length: $result")
        LogUtil.i("空testNullActivity: ${testNullActivity?.mTestInt}")
        val content = resources.getString(R.string.app_name) + "$result"
        LogUtil.i(content)

        val i = testNullActivity?.mTestInt
        LogUtil.i("变量为空的时候: ${i ?: 10}")
    }

}